/*
 * @(#)cn.design.pattern.mediator 2020/4/26/0026
 *
 * Copy Right@ 人人译视界
 */


package cn.design.pattern.mediator;

/**
 * <pre>
 * @author tuwei
 *
 * @version 0.9
 *
 * 修改版本: 0.9
 * 修改日期: 2020/4/26/0026
 * 修改人 :  tuwei
 * 修改说明: 初步完成
 * 复审人 ：
 * </pre>
 */
public class Alarm extends Colleague {

	public Alarm(Mediator mediator, String name) {
		super(mediator, name);
		mediator.register(name, this);
	}

	public void sendAlarm(int stateChange) {
		sendMessage(stateChange);
	}
	@Override
	void sendMessage(int stateChange) {
		this.getMediator().getMessage(stateChange, this.name);
	}
}
